<!--
/**
* Set user's preferences for session
* 
* @package     Heurist academic knowledge management system
* @link        http://HeuristNetwork.org
* @copyright   (C) 2005-2014 University of Sydney
* @author      Artem Osmakov   <artem.osmakov@sydney.edu.au>
* @license     http://www.gnu.org/licenses/gpl-3.0.txt GNU License 3.0
* @version     4.0
*/

/*
* Licensed under the GNU License, Version 3.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at http://www.gnu.org/licenses/gpl-3.0.txt
* Unless required by applicable law or agreed to in writing, software distributed under the License is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied
* See the License for the specific language governing permissions and limitations under the License.
*/
-->


<script type="text/javascript">

    function populateLanguages(){
        var sel = $("#layout_language");
        if(!(typeof regional === 'undefined') && sel.length==1){ //global variable defined in localization.js

            var key;
            sel.empty();
            sel = sel.get(0);
            for(key in regional){
                if(key){
                    top.HEURIST4.util.addoption(sel, key, regional[key].language);
                }
            }
        }
    }
    
    function populateLayouts(){
        var sel = $("#layout_id");
        if(sel.length==1){ //global variable defined in layout_default.js

            var key;
            sel.empty();
            sel = sel.get(0);
            for(key in layouts){
                if(key){
                    top.HEURIST4.util.addoption(sel, layouts[key]['id'], layouts[key]['name']);
                }
            }
        }
    }
    
</script>

<form>
    <fieldset>
        <h3>Search</h3>
        <div>
            <div class="header"><label for="search_limit">Block size for loading record data</label></div>
            <select name="search_limit" id="search_limit" class="text ui-widget-content ui-corner-all" style="min-width:300px"
                title="Larger = faster (for large databases, up to 1000), Smaller = more progress reporting (for slow connections)">
                <option value="2000">2000</option>
                <option value="1000">1000</option>
                <option value="500">500</option>
                <option value="200">200</option>
                <option value="100">100</option>
            </select>
        </div>
        <div>
            <div class="header"><label for="defaultSearch">Heurist search string to execute when loading the search page</label></div>
            <input name="defaultSearch" id="defaultSearch" class="text ui-widget-content ui-corner-all h3pref" style="min-width:300px"/>
        </div>
        <div>
            <div class="header"><label for="searchQueryInBrowser">Show current search query in browser address field</label></div>
            <input type="checkbox" name="searchQueryInBrowser" id="searchQueryInBrowser" class="text ui-widget-content ui-corner-all h3pref"/>
        </div>

        <hr />
        <h3>Edit</h3>
        <div>
            <div class="header"><label for="showSearchQueryInBrowser">When saving record, prompt for tags if no tags have been set</label></div>
            <input type="checkbox" name="showSearchQueryInBrowser" id="showSearchQueryInBrowser" class="text ui-widget-content ui-corner-all h3pref"/>
        </div>
        <div>
            <div class="header"><label for="defaultRecentPointerSearch">When entering a pointer field in record edit, default to recent records search (otherwise All Records)</label></div>
            <input type="checkbox" name="defaultRecentPointerSearch" id="defaultRecentPointerSearch" class="text ui-widget-content ui-corner-all h3pref"/>
        </div>
        <div>
            <div class="header"><label for="findFuzzyMatches">Check for similar records on creation (can slow down new record save significantly)</label></div>
            <input type="checkbox" name="findFuzzyMatches" id="findFuzzyMatches" class="text ui-widget-content ui-corner-all h3pref"/>
        </div>
        <div>
            <div class="header"><label for="record-edit-advancedmode">Advanced edit mode</label></div>
            <input type="checkbox" name="record-edit-advancedmode" id="record-edit-advancedmode" class="text ui-widget-content ui-corner-all h3pref"/>
        </div>
        
    
        <hr />
        <h3>Appearance</h3>
        <div>
            <div class="header"><label for="layout_id">Layout</label></div>
            <select name="layout_id" id="layout_id" class="text ui-widget-content ui-corner-all" style="min-width:300px"></select>
        </div>
        <div>
            <div class="header"><label for="layout_language">Language</label></div>
            <select name="layout_language" id="layout_language" class="text ui-widget-content ui-corner-all" style="min-width:300px"></select>
        </div>
        <div>
            <div class="header"><label for="layout_theme">Theme</label></div>
            <div id="layout_theme" style="min-width: 300px;"></div>
            <!-- <select name="layout_theme" id="layout_theme" class="text ui-widget-content ui-corner-all"></select> -->
        </div>
        <div>
            <div class="header"><label for="help_on">Show help</label></div>
            <input type="checkbox" name="help_on" id="help_on" class="text ui-widget-content ui-corner-all"/>
        </div>

<!--        
        <br />
        <hr />
        <br />

        <div>
            <div class="header"><label for="edit_open_in_new_window">Open edit in new window</label></div>
            <input type="checkbox" name="edit_open_in_new_window" id="edit_open_in_new_window" class="text ui-widget-content ui-corner-all" value="1"/>
        </div>
        <div>
            <div class="header"><label for="edit_force_tags">When exiting record edit, prompt for tags if no tags have been set</label></div>
            <input type="checkbox" name="edit_force_tags" id="edit_force_tags" class="text ui-widget-content ui-corner-all" value="1"/>
        </div>
        <div>
            <div class="header"><label for="edit_pointer_recentsearch">When entering a pointer field, default to recent records search (otherwise All Records)</label></div>
            <input type="checkbox" name="edit_pointer_recentsearch" id="edit_pointer_recentsearch" class="text ui-widget-content ui-corner-all" value="1"/>
        </div>
-->
    </fieldset>
  </form>
  <br />
  <p class="messages"></p>